import { request } from "@/utils/service"
import * as instance from '@/api/menu/types/instance'

export function saveOrUpdate(data: instance.menuFormInstance) {
  return request({
    url: "/bg/menu/saveOrUpdate",
    method: "post",
    data
  })
}

export function getMenuByLevel(params: instance.levelFormInstance) {
  return request({
    url: "/bg/menu/getMenuByLevel",
    method: "get",
    params
  })
}

export function getMenuById(params: instance.getByIdFormInstance) {
  return request({
    url: "/bg/menu/getMenuById",
    method: "get",
    params
  })
}

export function getList(params: instance.tableRequestData) {
  return request({
    url: "/bg/menu/getList",
    method: "get",
    params
  })
}

export function getAllMenu(params: any) {
  return request({
    url: "/bg/menu/getAllMenu",
    method: "get",
    params
  })
}

export function deleteById(data: instance.delFormInstance) {
  return request({
    url: "/bg/menu/deleteById",
    method: "post",
    data
  })
}
